<template>
  <div class="login">
    <div class="logo">
      <img src="http://xl.9yuecloud.com/assets/img/login.a4c656a9.png" alt="" />
    </div>
    <div class="form">
      <van-form @submit="onSubmit">
        <!-- <van-field
            v-model="dataList.username"
            name="手机号"
            label="手机号"
            placeholder="手机号"
            :rules="[{ required: true, message: '请填写手机号' }]"
          /> -->

        <van-field
          v-model="dataList.telephone"
          center
          clearable
          placeholder="请输入手机号"
        >
          <template #button>
            <van-button size="small" type="primary" @click="sunYz">发送验证码</van-button>
          </template>
        </van-field>
        <van-field
          v-model="dataList.sms_code"
          name="验证码"
          placeholder="验证码"
          :rules="[{ required: true, message: '请填写短信验证码' }]"
        />
        <div class="others">
          <span class="forget">*未注册的手机号将自动注册</span
          ><span class="login_CAPTCHA" @click="$router.push('/login')">登录</span>
        </div>
        <div style="margin: 16px">
          <van-button round block type="info" native-type="submit" @click="btn"
            >登录</van-button
          >
        </div>
      </van-form>
    </div>
  </div>
</template>
    
<script>
import { login, reset } from "../request/http";
export default {
  data() {
    return {
      dataList: {
        telephone:'',
        sms_code:'',
        type:2
      },
    };
  },
  created() {
  },
  methods: {
    btn() {
      login(this.dataList).then((res) => {
        console.log(res);
      });
    },
    onSubmit(values) {
      console.log("submit", values);
    },
    sunYz(){
        reset({
            mobile:this.telephone,
            sms_type:'login'
        }).then((res) => {
        console.log(res);
        });
    }
  },
};
</script>
    
    <style scoped lang="scss">
.login {
  height: 100vh;
  background-color: #fff;
  overflow: auto;
}
.logo {
  font-size: 12px;
  width: 70%;
  height: 1.36rem;
  margin: 1.6rem auto;
  background-color: #fff;
  box-sizing: border-box;
  img {
    width: 100%;
  }
}
.form {
  font-size: 12px;
  width: 83%;
  margin: 0 auto;
  .others {
    width: 90%;
    display: flex;
    margin: 0.133rem auto;
    justify-content: space-between;
  }
  .btn {
    margin-top: 1.333rem;
  }
  .otherLogin {
    width: 95%;
    margin: 0.533rem auto;
    text-align: center;
    .txLogin {
      display: flex;
      margin-top: 0.8rem;
      img {
        width: 1.013rem;
        height: 0.747rem;
        margin-right: 0.533rem;
      }
      span {
        font-size: 0.4rem;
        font-family: PingFangSC-Regular;
        font-weight: 400;
        color: #8c8c8c;
      }
      .wxLogin,
      .qqLogin {
        width: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
      }
      .wxLogin {
        border-right: 1px solid #f1f1f1;
      }
    }
  }
}
</style>